package com.lmx.repoDomain.tmodel;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import io.katharsis.resource.annotations.JsonApiIncludeByDefault;
import io.katharsis.resource.annotations.JsonApiResource;
import io.katharsis.resource.annotations.JsonApiToOne;

/**
 * 考核细项
 *
 * @author ytche
 * @date 2017年6月28日
 *
 */
@Entity
@Table(name = "tnb_assessment_indicator")
@JsonApiResource(type = "assessmentIndicator")
public class AssessmentIndicator extends BaseEntity {
	private static final long serialVersionUID = 1L;
	private String name;
	private Integer level;
	private AssessmentIndicator parent;
	private Integer maxScore;
	private String remark;
	private Integer activeStatus;

	@Column(name = "name")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "level")
	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	@ManyToOne(fetch = FetchType.EAGER, cascade = CascadeType.REFRESH)
	@Fetch(FetchMode.JOIN)
	@JsonApiIncludeByDefault
	@JsonApiToOne
	@JoinColumn(name = "parent_id")
	public AssessmentIndicator getParent() {
		return parent;
	}

	public void setParent(AssessmentIndicator parent) {
		this.parent = parent;
	}

	@Column(name = "max_score")
	public Integer getMaxScore() {
		return maxScore;
	}

	public void setMaxScore(Integer maxScore) {
		this.maxScore = maxScore;
	}

	@Column(name = "remark")
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "active_status")
	public Integer getActiveStatus() {
		return activeStatus;
	}

	public void setActiveStatus(Integer activeStatus) {
		this.activeStatus = activeStatus;
	}
}
